﻿


'*******************************************************************
' Program: Data Center Visio Rack Tool
' Author: Albert E Edlund
' Date:
'
' Purpose:
'
'
'
'*******************************************************************


Imports Microsoft.Practices.EnterpriseLibrary.Common
Imports Microsoft.Practices.EnterpriseLibrary.Data
Imports Microsoft.Practices.EnterpriseLibrary.ExceptionHandling
Imports Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging


Imports System
Imports System.ComponentModel
Imports System.Collections.Generic




Public Class dc_Draw
    Implements INotifyPropertyChanged


#Region "Events"

    Public Event PropertyChanged(ByVal sender As Object, ByVal e As System.ComponentModel.PropertyChangedEventArgs) Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged

    Private Sub OnPropertyChanged(ByVal info As String)
        RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(info))
    End Sub

#End Region

#Region " Constructor "

    Public Sub New()
        initProperties()
    End Sub

    Public Sub New(ByVal strUserId As String)
        initProperties()
        Me.m_drawlastedit = strUserId
    End Sub

#End Region

#Region " Properties and Fields "

    Private m_drawkey As Int32
    Private m_drawcompkey As Int32
    Private m_drawdocumentname As String
    Private m_drawpagename As String
    Private m_drawpinx As Double
    Private m_drawpiny As Double
    Private m_drawgeneric As Double
    Private m_drawcomments As String
    Private m_drawlastupdate As Date
    Private m_drawlastedit As String

    Private Const constDrawKey As Int32 = -1
    Private Const constDrawCompKey As Int32 = -1
    Private Const constDrawDocumentName As String = "na"
    Private Const constDrawPageName As String = "na"
    Private Const constDrawPinX As Double = 0
    Private Const constDrawPinY As Double = 0
    Private Const constDrawGeneric As String = "false"
    Private Const constDrawComments As String = "na"
    Private Const constDrawLastUpdate As Date = #1/1/2001#
    Private Const constDrawLastEdit As String = "na"

    Public Property drawKey() As Int32
        Get
            Return Me.m_drawkey
        End Get
        Set(ByVal value As Int32)
            Me.m_drawkey = value
            Me.OnPropertyChanged("drawKey")
        End Set
    End Property

    Public Property drawCompKey() As Int32
        Get
            Return Me.m_drawcompkey
        End Get
        Set(ByVal value As Int32)
            Me.m_drawcompkey = value
            Me.OnPropertyChanged("drawCompKey")
        End Set
    End Property


    Public Property drawDocumentName() As String
        Get
            Return Me.m_drawdocumentname
        End Get
        Set(ByVal value As String)
            Me.m_drawdocumentname = value
            Me.OnPropertyChanged("drawDocumentName")
        End Set
    End Property

    Public Property drawPageName() As String
        Get
            Return Me.m_drawpagename
        End Get
        Set(ByVal value As String)
            Me.m_drawpagename = value
            Me.OnPropertyChanged("drawPageName")
        End Set
    End Property

    Public Property drawPinX() As Double
        Get
            Return Me.m_drawpinx
        End Get
        Set(ByVal value As Double)
            Me.m_drawpinx = value
            Me.OnPropertyChanged("drawPinX")
        End Set
    End Property

    Public Property drawPinY() As Double
        Get
            Return Me.m_drawpiny
        End Get
        Set(ByVal value As Double)
            Me.m_drawpiny = value
            Me.OnPropertyChanged("drawPinY")
        End Set
    End Property

    Public Property drawGeneric() As String
        Get
            Return Me.m_drawgeneric
        End Get
        Set(ByVal value As String)
            Me.m_drawgeneric = value
            Me.OnPropertyChanged("drawGeneric")
        End Set
    End Property

    Public Property drawComments() As String
        Get
            Return Me.m_drawcomments
        End Get
        Set(ByVal value As String)
            Me.m_drawcomments = value
            Me.OnPropertyChanged("drawComments")
        End Set
    End Property

    Public Property drawLastUpdate() As Date
        Get
            Return Me.m_drawlastupdate
        End Get
        Set(ByVal value As Date)
            Me.m_drawlastupdate = value
            Me.OnPropertyChanged("drawLastUpdate")
        End Set
    End Property

    Public Property drawLastEdit() As String
        Get
            Return Me.m_drawlastedit
        End Get
        Set(ByVal value As String)
            Me.m_drawlastedit = value
            Me.OnPropertyChanged("drawLastEdit")
        End Set
    End Property

#End Region

#Region " Methods "


    Public Sub initProperties()

        Try
            drawKey = constDrawKey
            drawCompKey = constDrawCompKey
            drawDocumentName = constDrawDocumentName
            drawPageName = constDrawPageName
            drawPinX = constDrawPinX
            drawPinY = constDrawPinY
            drawGeneric = constDrawGeneric
            drawComments = constDrawComments
            drawLastUpdate = Now
            drawLastEdit = constDrawLastEdit

        Catch ex As Exception
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(ex, "Log Only Policy")
            If (rethrow) Then
                Throw
            End If
        End Try

    End Sub




#End Region


End Class


